package com.qf.controller;

import com.qf.entity.TbStudent;
import com.qf.service.TbAssignmentbookService;
import com.qf.service.TbStudentService;
import com.qf.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpSession;

/**
 * @author 10202
 * @version V1.0
 * @Project management-system
 * @Package com.qf.controller
 * @Date 2023/5/21 10:35
 */
@RestController
@RequestMapping("/assignmentbook")
@MultipartConfig
public class AssignmentBookController {

    private final TbAssignmentbookService tbAssignmentbookService;

    public AssignmentBookController(TbAssignmentbookService tbAssignmentbookService) {
        this.tbAssignmentbookService = tbAssignmentbookService;
    }

    @PostMapping("sendbook")
    public Result  sendbook(@RequestParam(value = "afile", required = false) MultipartFile file, String title, String background, String work, Long studentId, HttpSession session){
        return tbAssignmentbookService.sendbook( file,title,background,work,studentId,session);
    }
}
